home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-12-12 | 1.6 KB | 63 lines | [TEXT/ttxt] |
- class DirectorImporter (Importer)
- end
-
- method init self {class DirectorImporter} #rest args -> (
- args := merge args #(@mediaCategory,@Metaphor,@inputMediaType,@Director,@outputMediaType,@ScorePlayer)
- apply nextMethod self args
- )
-
- method importFromStream self {class DirectorImporter} source #rest args \
- #key container: \
- outputMediaType: ->
- (
-
- local theDTK
- local theScoreTranslator
-
- -- Make a DTK for the chosen file
- theDTK := new DTK directorFileName:source container:container
-
- -- This translator converts castmembers
- theDTK.castTranslator := new ScorePlayerCastTranslator
-
- if outputMediaType = @castList then
- (
- translateDirector theDTK
- return theDTK.castList
- ) else
- (
- -- We want a ScorePlayer back
- theScoreTranslator := new ScorePlayerScoreTranslator
- theDTK.scoreTranslator := theScoreTranslator
-
- translateDirector theDTK
-
- theScoreTranslator.scorePlayer.brushCache := theDTK.castTranslator.brushCache
- return theScoreTranslator.scorePlayer
- )
- )
-
- function registerDirectorImporter ->
- (
- local directorImporterRep
- local anArray
- local aPropertyCollection
-
- directorImporterRep := new ClassRepresentative \
- owner:@OwnerSubstrate \
- type:@TypeGestalt \
- subtype: @subTypeImportExport \
- version: "1.0" \
- vendor: @VendorKaleida \
- free: false
-
- addProperty directorImporterRep @mediaCategoryProp @Metaphor
- addProperty directorImporterRep @mediaInputTypeProp @Director
-
- anArray := #(@ScorePlayer, @CastList)
- aPropertyCollection := newPropertyCollection Manager anArray
- addProperty directorImporterRep @mediaOutputTypeProp aPropertyCollection
-
- setClass directorImporterRep DirectorImporter
- )
-